package com.group.elmboot.po;

import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.enums.IdType;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;

@AllArgsConstructor
@Data
@NoArgsConstructor
public class Transition {

	@TableId(type = IdType.AUTO)
	private Integer transition_id;
	private String transition_time;
	private BigDecimal transition_amount;
	private Integer transition_type;//0为提现，1为充值，2为支付
	private String user_id_out;
	private String user_id_in;
	
	public Transition(String transitionTime, BigDecimal transitionAmount, Integer transitionType, String userIdOut,
                      String userIdIn) {
		this.transition_time = transitionTime;
		this.transition_amount = transitionAmount;
		this.transition_type = transitionType;
		this.user_id_out = userIdOut;
		this.user_id_in = userIdIn;
	}

	public Transition(String transitionTime, BigDecimal transitionAmount, Integer transitionType, String userId) {
		if (transitionType==0)
			this.user_id_out = userId;
		else
			this.user_id_in = userId;
		this.transition_time = transitionTime;
		this.transition_amount = transitionAmount;
		this.transition_type = transitionType;
	}
	
}
